import request from '@/utils/Request'
import { stringify } from 'qs';

export async function queryById(params) {
  return request(`/joker/blogs/queryById?${stringify(params)}`, {
    method: 'GET',
  });
}

export async function queryComments(params) {
  return request(`/joker/comment/queryByBlogId?${stringify(params)}`, {
    method: 'GET',
  });
}

export async function deleteComments(params) {
  return request(`/joker/comment/delete?${stringify(params)}`, {
    method: 'GET',
  });
}

export async function likeAction(params) {
  return request(`/joker/comment/action`, {
    method: 'POST',
    data: {
      ...params
    }
  });
}

export async function addComment(params) {
  return request(`/joker/comment/add`, {
    method: 'POST',
    data: {
      ...params
    }
  });
}

export async function blogAction(params) {
  return request(`/joker/blogs/update`, {
    method: 'POST',
    data: {
      ...params
    }
  });
}
